import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * user:likai
 * Date:2022-10-03
 * Time:20:43
 */
public class Test {
    public static int isOnly(char[]chars ) {

        for (int i = 0; i < chars.length-1; i++) {
            char a=chars[i];
            for (int j = i+1; j < chars.length; j++) {
                if(chars[i]==chars[j]){
                    return i;
                }
            }
        }
        return -1;
    }
    public static void main1(String[] args) {
        String str ="dsadsafsa";
        String string ="asdfghjkl";
        char []chars=str.toCharArray();
        char []chars1=string.toCharArray();
        int ret=isOnly(chars);
        System.out.println(ret);
        int ret1=isOnly(chars1);
        System.out.println(ret1);
    }

    public static void main2(String[] args) {
        String string="sadsafagds";
        int []a=new int[255];
        for (int i = 0; i < string.length(); i++) {
            a[string.charAt(i)]++;
        }
        for (int i = 0; i < string.length(); i++) {
            if(1==string.charAt(i)){
                System.out.println(i);
            }
            if(i==string.length()&&1!=string.charAt(i)){
                System.out.println(-1);
            }
        }
    }

    public static void main3(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while(scanner.hasNext()){
            String s=scanner.nextLine();
            //截取
            String a=s.substring(s.lastIndexOf(" ")+1,s.length());
            System.out.println(a.length());


            //拆分
//            String []a=s.split(" ");
//            String b=a[a.length-1];
//            System.out.println(b.length());
        }
    }

}
